package homework;

import java.util.Scanner;

public class Visitor {
	String name;

	int age;

	public void showVisitor() {
		if (age <= 18 || age >= 60) {
			System.out.println("免费 ");
		} else {
			System.out.println("原价");
		}
	}

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
		String answer;

		do {
			Visitor ren = new Visitor();
			System.out.println("请输入姓名:");
			ren.name = sc.next();

			System.out.println("请输入年龄:");
			ren.age = sc.nextInt();
			ren.showVisitor();

			System.out.println("是否继续(y/n)");
			answer = sc.next();
		} while (answer.equals("y"));
		System.out.println("程序结束！");
	}

}
